import { BaseEntity } from "src/baseEntity";
import { Dept } from "src/dept/dept.entity";
import { System } from "src/system/system.entity";
import { UserSys } from "src/user/userSys.entity";
import { Column, Entity, JoinTable, ManyToMany, ManyToOne } from "typeorm";


@Entity("property")
export class Property extends BaseEntity {
    @ManyToOne(() => System)
    system: System

    @ManyToOne(() => UserSys)
    user: UserSys

    @ManyToOne(() => UserSys)
    updUser: UserSys

    @Column({ comment: "类别" })
    type: string

    @Column({ comment: "名称" })
    name: string

    @Column({ comment: "规格" })
    range: string

    @Column({ comment: "数量" })
    count: number

    @Column({ comment: "单价" })
    price: number

    @ManyToMany(() => Dept)
    @JoinTable()
    depts: Dept[]
}